package com.ajx.todo.project.adplatform;

import android.arch.lifecycle.LifecycleActivity;
import android.os.Bundle;
import android.support.annotation.Nullable;

import com.ajx.todo.R;
import com.ajx.todo.project.adplatform.utils.MqttClient;
import com.ajx.todo.project.adplatform.utils.PlatformAttribute;
import com.ajx.todo.project.adplatform.video.SampleVideo;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by lai on 2017/9/9.
 */

public class ADActivity extends LifecycleActivity {


    @BindView(R.id.sv)
    SampleVideo sampleVideo;
    private MqThread mqThread;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ad);
        ButterKnife.bind(this);
        init();
    }

    private void init() {
           if (mqThread==null){
               mqThread=new MqThread();
           }
           mqThread.start();
    }
    class MqThread extends Thread{
        @Override
        public void run() {
            super.run();
            MqttClient.start(PlatformAttribute.getMachineId(),ADActivity.this);
        }
    }
}
